{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7ecc7207",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:21:59.732589Z",
     "start_time": "2021-10-17T03:21:57.465094Z"
    }
   },
   "outputs": [],
   "source": [
    "from autogluon.tabular import TabularDataset, TabularPredictor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4a392ef1",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:22:00.323885Z",
     "start_time": "2021-10-17T03:22:00.302934Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/caihengxing/anaconda3/envs/python37/lib/python3.7/site-packages/ipykernel/ipkernel.py:287: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n",
      "  and should_run_async(code)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "['sample_submission.csv',\n",
       " 'train.csv',\n",
       " 'train.csv.zip',\n",
       " 'test.csv',\n",
       " 'test.csv.zip',\n",
       " 'sample_submission.csv.zip',\n",
       " 'allstate-claims-severity.zip']"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os\n",
    "os.listdir('../autox/data/allstate_claims')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6bc8546b",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:22:08.016889Z",
     "start_time": "2021-10-17T03:22:03.787271Z"
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "train_data = TabularDataset('../autox/data/allstate_claims/train.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "21370fd8",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:22:08.025811Z",
     "start_time": "2021-10-17T03:22:08.020109Z"
    },
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(188318, 132)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "4ba99057",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:22:08.051732Z",
     "start_time": "2021-10-17T03:22:08.027397Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>cat1</th>\n",
       "      <th>cat2</th>\n",
       "      <th>cat3</th>\n",
       "      <th>cat4</th>\n",
       "      <th>cat5</th>\n",
       "      <th>cat6</th>\n",
       "      <th>cat7</th>\n",
       "      <th>cat8</th>\n",
       "      <th>cat9</th>\n",
       "      <th>...</th>\n",
       "      <th>cont6</th>\n",
       "      <th>cont7</th>\n",
       "      <th>cont8</th>\n",
       "      <th>cont9</th>\n",
       "      <th>cont10</th>\n",
       "      <th>cont11</th>\n",
       "      <th>cont12</th>\n",
       "      <th>cont13</th>\n",
       "      <th>cont14</th>\n",
       "      <th>loss</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>...</td>\n",
       "      <td>0.718367</td>\n",
       "      <td>0.335060</td>\n",
       "      <td>0.30260</td>\n",
       "      <td>0.67135</td>\n",
       "      <td>0.83510</td>\n",
       "      <td>0.569745</td>\n",
       "      <td>0.594646</td>\n",
       "      <td>0.822493</td>\n",
       "      <td>0.714843</td>\n",
       "      <td>2213.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>...</td>\n",
       "      <td>0.438917</td>\n",
       "      <td>0.436585</td>\n",
       "      <td>0.60087</td>\n",
       "      <td>0.35127</td>\n",
       "      <td>0.43919</td>\n",
       "      <td>0.338312</td>\n",
       "      <td>0.366307</td>\n",
       "      <td>0.611431</td>\n",
       "      <td>0.304496</td>\n",
       "      <td>1283.60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>5</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>...</td>\n",
       "      <td>0.289648</td>\n",
       "      <td>0.315545</td>\n",
       "      <td>0.27320</td>\n",
       "      <td>0.26076</td>\n",
       "      <td>0.32446</td>\n",
       "      <td>0.381398</td>\n",
       "      <td>0.373424</td>\n",
       "      <td>0.195709</td>\n",
       "      <td>0.774425</td>\n",
       "      <td>3005.09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>10</td>\n",
       "      <td>B</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>...</td>\n",
       "      <td>0.440945</td>\n",
       "      <td>0.391128</td>\n",
       "      <td>0.31796</td>\n",
       "      <td>0.32128</td>\n",
       "      <td>0.44467</td>\n",
       "      <td>0.327915</td>\n",
       "      <td>0.321570</td>\n",
       "      <td>0.605077</td>\n",
       "      <td>0.602642</td>\n",
       "      <td>939.85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>11</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>...</td>\n",
       "      <td>0.178193</td>\n",
       "      <td>0.247408</td>\n",
       "      <td>0.24564</td>\n",
       "      <td>0.22089</td>\n",
       "      <td>0.21230</td>\n",
       "      <td>0.204687</td>\n",
       "      <td>0.202213</td>\n",
       "      <td>0.246011</td>\n",
       "      <td>0.432606</td>\n",
       "      <td>2763.85</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 132 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   id cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9  ...     cont6     cont7  \\\n",
       "0   1    A    B    A    B    A    A    A    A    B  ...  0.718367  0.335060   \n",
       "1   2    A    B    A    A    A    A    A    A    B  ...  0.438917  0.436585   \n",
       "2   5    A    B    A    A    B    A    A    A    B  ...  0.289648  0.315545   \n",
       "3  10    B    B    A    B    A    A    A    A    B  ...  0.440945  0.391128   \n",
       "4  11    A    B    A    B    A    A    A    A    B  ...  0.178193  0.247408   \n",
       "\n",
       "     cont8    cont9   cont10    cont11    cont12    cont13    cont14     loss  \n",
       "0  0.30260  0.67135  0.83510  0.569745  0.594646  0.822493  0.714843  2213.18  \n",
       "1  0.60087  0.35127  0.43919  0.338312  0.366307  0.611431  0.304496  1283.60  \n",
       "2  0.27320  0.26076  0.32446  0.381398  0.373424  0.195709  0.774425  3005.09  \n",
       "3  0.31796  0.32128  0.44467  0.327915  0.321570  0.605077  0.602642   939.85  \n",
       "4  0.24564  0.22089  0.21230  0.204687  0.202213  0.246011  0.432606  2763.85  \n",
       "\n",
       "[5 rows x 132 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "ec3eacc4",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:22:08.468160Z",
     "start_time": "2021-10-17T03:22:08.463879Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/caihengxing/anaconda3/envs/python37/lib/python3.7/site-packages/ipykernel/ipkernel.py:287: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n",
      "  and should_run_async(code)\n"
     ]
    }
   ],
   "source": [
    "label = 'loss'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "a225cdb6",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:55:28.606061Z",
     "start_time": "2021-10-17T03:22:13.736356Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Warning: Training may take a very long time because `time_limit` was not specified and `train_data` is large (188318 samples, 1291.87 MB).\n",
      "\tConsider setting `time_limit` to ensure training finishes within an expected duration or experiment with a small portion of `train_data` to identify an ideal `presets` and `hyperparameters` configuration.\n",
      "Beginning AutoGluon training ...\n",
      "AutoGluon will save models to \"agModels-kaggle_allstate_claims/\"\n",
      "AutoGluon Version:  0.2.1b20210716\n",
      "Train Data Rows:    188318\n",
      "Train Data Columns: 131\n",
      "Preprocessing data ...\n",
      "AutoGluon infers your prediction problem is: 'regression' (because dtype of label-column == float and many unique label-values observed).\n",
      "\tLabel info (max, min, mean, stddev): (121012.25, 0.67, 3037.33769, 2904.08619)\n",
      "\tIf 'regression' is not the correct problem_type, please manually specify the problem_type argument in fit() (You may specify problem_type as one of: ['binary', 'multiclass', 'regression'])\n",
      "Using Feature Generators to preprocess the data ...\n",
      "Fitting AutoMLPipelineFeatureGenerator...\n",
      "\tAvailable Memory:                    256636.11 MB\n",
      "\tTrain Data (Original)  Memory Usage: 1290.36 MB (0.5% of available memory)\n",
      "\tInferring data type of each feature based on column values. Set feature_metadata_in to manually specify special dtypes of the features.\n",
      "\tStage 1 Generators:\n",
      "\t\tFitting AsTypeFeatureGenerator...\n",
      "\tStage 2 Generators:\n",
      "\t\tFitting FillNaFeatureGenerator...\n",
      "\tStage 3 Generators:\n",
      "\t\tFitting IdentityFeatureGenerator...\n",
      "\t\tFitting CategoryFeatureGenerator...\n",
      "\t\t\tFitting CategoryMemoryMinimizeFeatureGenerator...\n",
      "\tStage 4 Generators:\n",
      "\t\tFitting DropUniqueFeatureGenerator...\n",
      "\tTypes of features in original data (raw dtype, special dtypes):\n",
      "\t\t('float', [])  :  14 | ['cont1', 'cont2', 'cont3', 'cont4', 'cont5', ...]\n",
      "\t\t('int', [])    :   1 | ['id']\n",
      "\t\t('object', []) : 116 | ['cat1', 'cat2', 'cat3', 'cat4', 'cat5', ...]\n",
      "\tTypes of features in processed data (raw dtype, special dtypes):\n",
      "\t\t('category', []) : 116 | ['cat1', 'cat2', 'cat3', 'cat4', 'cat5', ...]\n",
      "\t\t('float', [])    :  14 | ['cont1', 'cont2', 'cont3', 'cont4', 'cont5', ...]\n",
      "\t\t('int', [])      :   1 | ['id']\n",
      "\t8.0s = Fit runtime\n",
      "\t131 features in original data used to generate 131 features in processed data.\n",
      "\tTrain Data (Processed) Memory Usage: 44.67 MB (0.0% of available memory)\n",
      "Data preprocessing and feature engineering runtime = 8.83s ...\n",
      "AutoGluon will gauge predictive performance using evaluation metric: 'root_mean_squared_error'\n",
      "\tTo change this, specify the eval_metric argument of fit()\n",
      "Automatically generating train/validation split with holdout_frac=0.01327541711360571, Train Rows: 185818, Val Rows: 2500\n",
      "Fitting 11 L1 models ...\n",
      "Fitting model: KNeighborsUnif ...\n",
      "\t-3228.2483\t = Validation root_mean_squared_error score\n",
      "\t1.05s\t = Training runtime\n",
      "\t0.24s\t = Validation runtime\n",
      "Fitting model: KNeighborsDist ...\n",
      "\t-3305.7786\t = Validation root_mean_squared_error score\n",
      "\t1.18s\t = Training runtime\n",
      "\t0.11s\t = Validation runtime\n",
      "Fitting model: LightGBMXT ...\n",
      "\t-1902.7712\t = Validation root_mean_squared_error score\n",
      "\t8.21s\t = Training runtime\n",
      "\t0.11s\t = Validation runtime\n",
      "Fitting model: LightGBM ...\n",
      "\t-1917.0028\t = Validation root_mean_squared_error score\n",
      "\t5.82s\t = Training runtime\n",
      "\t0.11s\t = Validation runtime\n",
      "Fitting model: RandomForestMSE ...\n",
      "\t-2087.4316\t = Validation root_mean_squared_error score\n",
      "\t110.01s\t = Training runtime\n",
      "\t0.51s\t = Validation runtime\n",
      "Fitting model: CatBoost ...\n",
      "\t-1960.7411\t = Validation root_mean_squared_error score\n",
      "\t37.98s\t = Training runtime\n",
      "\t0.21s\t = Validation runtime\n",
      "Fitting model: ExtraTreesMSE ...\n",
      "\t-1973.2286\t = Validation root_mean_squared_error score\n",
      "\t67.94s\t = Training runtime\n",
      "\t0.6s\t = Validation runtime\n",
      "Fitting model: NeuralNetFastAI ...\n",
      "/home/caihengxing/anaconda3/envs/python37/lib/python3.7/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 10010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:115.)\n",
      "  return torch._C._cuda_getDeviceCount() > 0\n",
      "No improvement since epoch 6: early stopping\n",
      "\t-1930.6229\t = Validation root_mean_squared_error score\n",
      "\t1663.51s\t = Training runtime\n",
      "\t0.21s\t = Validation runtime\n",
      "Fitting model: XGBoost ...\n",
      "\t-1920.6027\t = Validation root_mean_squared_error score\n",
      "\t38.08s\t = Training runtime\n",
      "\t0.18s\t = Validation runtime\n",
      "Fitting model: NeuralNetMXNet ...\n",
      "\tWarning: Exception caused NeuralNetMXNet to fail during training... Skipping this model.\n",
      "\t\tLegacy mxnet==1.4.0 detected, some new modules will not work properly. mxnet>=1.6.0 is required. You can use pip to upgrade mxnet `pip install mxnet --upgrade` or `pip install mxnet_cu101 --upgrade`\n",
      "Detailed Traceback:\n",
      "Traceback (most recent call last):\n",
      "  File \"/mnt/disk0/home/caihengxing/software/autogluon-master/tabular/src/autogluon/tabular/trainer/abstract_trainer.py\", line 960, in _train_and_save\n",
      "    model = self._train_single(X, y, model, X_val, y_val, **model_fit_kwargs)\n",
      "  File \"/mnt/disk0/home/caihengxing/software/autogluon-master/tabular/src/autogluon/tabular/trainer/abstract_trainer.py\", line 932, in _train_single\n",
      "    model = model.fit(X=X, y=y, X_val=X_val, y_val=y_val, **model_fit_kwargs)\n",
      "  File \"/mnt/disk0/home/caihengxing/software/autogluon-master/core/src/autogluon/core/models/abstract/abstract_model.py\", line 518, in fit\n",
      "    out = self._fit(**kwargs)\n",
      "  File \"/mnt/disk0/home/caihengxing/software/autogluon-master/tabular/src/autogluon/tabular/models/tabular_nn/tabular_nn_model.py\", line 168, in _fit\n",
      "    try_import_mxnet()\n",
      "  File \"/mnt/disk0/home/caihengxing/software/autogluon-master/core/src/autogluon/core/utils/try_import.py\", line 40, in try_import_mxnet\n",
      "    raise ValueError(msg)\n",
      "ValueError: Legacy mxnet==1.4.0 detected, some new modules will not work properly. mxnet>=1.6.0 is required. You can use pip to upgrade mxnet `pip install mxnet --upgrade` or `pip install mxnet_cu101 --upgrade`\n",
      "Fitting model: LightGBMLarge ...\n",
      "\t-1909.8342\t = Validation root_mean_squared_error score\n",
      "\t13.44s\t = Training runtime\n",
      "\t0.12s\t = Validation runtime\n",
      "Fitting model: WeightedEnsemble_L2 ...\n",
      "\t-1891.3409\t = Validation root_mean_squared_error score\n",
      "\t0.64s\t = Training runtime\n",
      "\t0.0s\t = Validation runtime\n",
      "AutoGluon training complete, total runtime = 1994.15s ...\n",
      "TabularPredictor saved. To load, use: predictor = TabularPredictor.load(\"agModels-kaggle_allstate_claims/\")\n"
     ]
    }
   ],
   "source": [
    "save_path = 'agModels-kaggle_allstate_claims'  # specifies folder to store trained models\n",
    "predictor = TabularPredictor(label=label, path=save_path).fit(train_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "fa84c4eb",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:55:30.736745Z",
     "start_time": "2021-10-17T03:55:28.608771Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/caihengxing/anaconda3/envs/python37/lib/python3.7/site-packages/ipykernel/ipkernel.py:287: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n",
      "  and should_run_async(code)\n",
      "Loaded data from: ../autox/data/allstate_claims/test.csv | Columns = 131 / 131 | Rows = 125546 -> 125546\n"
     ]
    }
   ],
   "source": [
    "test_data_nolab = TabularDataset('../autox/data/allstate_claims/test.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "54cce4ce",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:55:57.087041Z",
     "start_time": "2021-10-17T03:55:30.738880Z"
    }
   },
   "outputs": [],
   "source": [
    "y_pred = predictor.predict(test_data_nolab)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "ca6cc9bf",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:55:57.094162Z",
     "start_time": "2021-10-17T03:55:57.088821Z"
    },
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/caihengxing/anaconda3/envs/python37/lib/python3.7/site-packages/ipykernel/ipkernel.py:287: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n",
      "  and should_run_async(code)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0         1688.878906\n",
       "1         2162.439697\n",
       "2         9621.832031\n",
       "3         7131.879395\n",
       "4         1001.167297\n",
       "             ...     \n",
       "125541    2556.607910\n",
       "125542    2805.329102\n",
       "125543    2776.661621\n",
       "125544    1371.867676\n",
       "125545    3802.659668\n",
       "Name: loss, Length: 125546, dtype: float32"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "240cd16c",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:55:57.097438Z",
     "start_time": "2021-10-17T03:55:57.095392Z"
    }
   },
   "outputs": [],
   "source": [
    "id_ = ['id']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "b4fd354e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:55:57.127880Z",
     "start_time": "2021-10-17T03:55:57.098684Z"
    }
   },
   "outputs": [],
   "source": [
    "sub = test_data_nolab[id_].copy()\n",
    "sub[label] = list(y_pred.values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "c59b336a",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:55:57.395696Z",
     "start_time": "2021-10-17T03:55:57.129318Z"
    }
   },
   "outputs": [],
   "source": [
    "sub.to_csv(\"./autogluon_sub_kaggle_allstate_claims.csv\", index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "c43926aa",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-10-17T03:55:57.400187Z",
     "start_time": "2021-10-17T03:55:57.398045Z"
    }
   },
   "outputs": [],
   "source": [
    "# !zip -r autogluon_sub_kaggle_ventilator.csv.zip autogluon_sub_kaggle_ventilator.csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6b54628e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
